package com.foreknow.mapping;

import com.foreknow.model.Guestbook;

import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;

public class GuestbookImpl implements EntityMapping {
    @Override
    public Object mapping(ResultSet rs) throws SQLException {
        Guestbook guestbook = new Guestbook();
//        List<Guestbook> list = new ArrayList<>();
//        while (rs.next()){
//
//        }
        guestbook.setId(rs.getInt("id"));
        guestbook.setName(rs.getString("name"));
        guestbook.setPhone(rs.getString("phone"));
        guestbook.setEmail(rs.getString("email"));
        guestbook.setTitle(rs.getString("title"));
        guestbook.setContent(rs.getString("content"));
        guestbook.setCreatetime(rs.getString("createtime"));

        return  guestbook;
    }
}
